<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>13-图片移动</title>
		<style type="text/css">
			img{
				cursor: move;
			}
		</style>
	</head>
	<body>
		<img src="images/angel.gif" alt="">
		<script type="text/javascript">
			//给文档绑定移动事件
			var img = document.querySelector('img');
			document.addEventListener('mousemove',function(e){
				//动
				console.log(e);
				img.style.position='absolute';
				img.style.left = e.pageX-40+'px';
				img.style.top = e.pageY-70+'px';
			});
		</script>
	</body>
</html>
